<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      acpid-2.0.32
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;12.&nbsp;System Utilities
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="accountsservice.html" title=
          "AccountsService-0.6.55">Prev</a>
          <p>
            AccountsService-0.6.55
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="at.html" title="at-3.1.23">Next</a>
          <p>
            at-3.1.23
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="acpid" name="acpid"></a>acpid-2.0.32
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to acpid
        </h2>
        <p>
          The <span class="application">acpid</span> (Advanced Configuration
          and Power Interface event daemon) is a completely flexible, totally
          extensible daemon for delivering ACPI events. It listens on netlink
          interface and when an event occurs, executes programs to handle the
          event. The programs it executes are configured through a set of
          configuration files, which can be dropped into place by packages or
          by the user.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://downloads.sourceforge.net/acpid2/acpid-2.0.32.tar.xz">
                https://downloads.sourceforge.net/acpid2/acpid-2.0.32.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 248995264b9d1cd8bdb923d5b190fd44
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 156 KB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 2.5 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: less than 0.1 SBU
              </p>
            </li>
          </ul>
        </div>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/acpid">http://wiki.linuxfromscratch.org/blfs/wiki/acpid</a>
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of acpid
        </h2>
        <p>
          Install <span class="application">acpid</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr \
            --docdir=/usr/share/doc/acpid-2.0.32 &amp;&amp;
make</kbd>
</pre>
        <p>
          This package does not come with a test suite.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install                         &amp;&amp;
install -v -m755 -d /etc/acpi/events &amp;&amp;
cp -r samples /usr/share/doc/acpid-2.0.32</kbd>
</pre>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring acpid
        </h2>
        <p>
          <span class="application">acpid</span> is configured by user
          defined events. Place event files under <code class=
          "filename">/etc/acpi/events</code> directory. If an event occurs,
          <span class="command"><strong>acpid</strong></span> recurses
          through the event files in order to see if the regex defined after
          "event" matches. If they do, action is executed.
        </p>
        <p>
          The following brief example will suspend the system when the laptop
          lid is closed (it requires <a class="xref" href="pm-utils.html"
          title="pm-utils-1.4.1">pm-utils-1.4.1</a>):
        </p>
        <pre class="root">
<kbd class="command">cat &gt; /etc/acpi/events/lid &lt;&lt; "EOF"
<code class="literal">event=button/lid
action=/etc/acpi/lid.sh</code>
EOF

cat &gt; /etc/acpi/lid.sh &lt;&lt; "EOF"
<code class="literal">#!/bin/sh
/bin/grep -q open /proc/acpi/button/lid/LID/state &amp;&amp; exit 0
/usr/sbin/pm-suspend</code>
EOF
chmod +x /etc/acpi/lid.sh</kbd>
</pre>
        <p>
          Unfortunately, not every computer labels ACPI events in the same
          way. To determine how your buttons are recognized, use the
          <span class="command"><strong>acpi_listen</strong></span> tool.
          Also, look in the <code class="filename">samples</code> directory
          under <code class="filename">/usr/share/doc/acpid-2.0.32</code> for
          more examples.
        </p>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="acpid-init" name="acpid-init"></a>
          </h3>
          <h4 class="title">
            <a id="acpid-init" name="acpid-init"></a><span class=
            "phrase">Boot Script</span>
          </h4>
          <p>
            To automatically start <span class=
            "command"><strong>acpid</strong></span> when the system is
            rebooted, install the <code class=
            "filename">/etc/rc.d/init.d/acpid</code> boot script from the
            <a class="xref" href="../introduction/bootscripts.html" title=
            "BLFS Boot Scripts">blfs-bootscripts-20191204</a> package.
          </p>
          <pre class="root">
<kbd class="command">make install-acpid</kbd>
</pre>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">acpid, acpi_listen, and kacpimon</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/etc/acpi and
              /usr/share/doc/acpid-2.0.32</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="acpid-prog" name="acpid-prog"></a><span class=
                    "term"><span class=
                    "command"><strong>acpid</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a program that listens for ACPI events and executes
                    the rules that match the received event.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="acpi_listen" name="acpi_listen"></a><span class=
                    "term"><span class=
                    "command"><strong>acpi_listen</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a simple tool which connects to <span class=
                    "command"><strong>acpid</strong></span> and listens for
                    events.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="kacpimon" name="kacpimon"></a><span class=
                    "term"><span class=
                    "command"><strong>kacpimon</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a monitor program that connects to three sources of
                    ACPI events (events file, netlink and input layer) and
                    then reports on what it sees while it is connected.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-15 20:23:35 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="accountsservice.html" title=
          "AccountsService-0.6.55">Prev</a>
          <p>
            AccountsService-0.6.55
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="at.html" title="at-3.1.23">Next</a>
          <p>
            at-3.1.23
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
